
#include "../libpatches.h"
#include "proc.h"

static void module_proc_processor(module m);

void module_proc_initializer(module m) {
	make_inputs(m, 3);
	make_outputs(m, 1);

	m->input_names[0] = "in";
	m->input_names[1] = "amp";
	m->input_names[2] = "off";
	m->output_names[0] = "out";

	patch_one(m->inputs + 1);

	m->processor = module_proc_processor;
}

static void module_proc_processor(module m) {
	output o = m->outputs[0];
	input i = m->inputs[0];
	input amp = m->inputs[1];
	input off = m->inputs[2];

	*o = **i * **amp + **off;
}

